package com.hmdp.config;

import io.lettuce.core.RedisClient;
import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author hyj
 * @create 2023--11--11
 */
@Configuration
public class RedissonConfig {

    @Bean
    public RedissonClient redissonClient(){
        //配置类
        Config config = new Config();
        //连接到Redis
        config.useSingleServer().setAddress("redis://192.168.57.100:6379").setPassword("123456");

        return Redisson.create(config);
    }

    @Bean
    public RedissonClient redissonClient2(){
        //配置类
        Config config = new Config();
        //连接到Redis
        config.useSingleServer().setAddress("redis://192.168.57.100:6380").setPassword("123456");

        return Redisson.create(config);
    }

    @Bean
    public RedissonClient redissonClient3(){
        //配置类
        Config config = new Config();
        //连接到Redis
        config.useSingleServer().setAddress("redis://192.168.57.100:6381").setPassword("123456");

        return Redisson.create(config);
    }
}
